Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script> function getCellContent(id,row,cell) { var x = document.getElementById(id).rows[0].cells; document.getElementById("demo").innerHTML = x[0].innerHTML; } </script> </head> <body> <table id="myTable" style="border: 1px solid black"> <tr> <td>cell 1</td> <td>cell 2</td> </tr> <tr> <td>cell 3</td> <td>cell 4</td> </tr> </table> <p> <input type="button" onclick="getCellContent('myTable',0,0)" value="Display first cell"> </p> <p id="demo"></p> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_dom_table_cells by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:37:11 GMT --> </html>
Result:
Try it Yourself - © w3schools.com